package com.demo.common.job;

import java.util.List;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.demo.common.model.Proxyip;
import com.jfinal.log.Log;

public class JobDelProxyIp implements Job {

	private static final Log log = Log.getLog(JobDelProxyIp.class);
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		log.debug("开始执行删除无效ip的任务");
		System.out.println("开始执行删除无效ip的任务");
		//获取无效的代理ip
		List<Proxyip> proxyipList = Proxyip.dao.find("SELECT * FROM proxyip WHERE isVali = 0");
		for (Proxyip proxyip : proxyipList) {
			proxyip.delete();
		}
		log.debug("删除无效ip任务结束");
	}

}
